<div th:fragment="pageBar(page)" class="dataTables_info" id="DataTables_Table_0_info" role="status" aria-live="polite"><label th:text="#{page.first}"></label>
    <font th:text="${page.current}">1</font> <label th:text="#{page.pages}"></label>，<label th:text="#{page.total}"></label> <font th:text="${page.getPages()}">1</font> <label th:text="#{page.pages}"></label>
</div>

<div th:fragment="pageBarJson(json)" class="dataTables_info" id="DataTables_Table_0_info" role="status" aria-live="polite"><label th:text="#{page.first}"></label>
    <font th:text="${json.getInteger('current')}">1</font> <label th:text="#{page.pages}"></label>，<label th:text="#{page.total}"></label> <font th:text="${json.getInteger('pages')}">1</font> <label th:text="#{page.pages}"></label>
</div>

<div th:fragment="pagination(page)" class="dataTables_paginate paging_simple_numbers">
    <a th:if="${page.current eq 1}" class="paginate_button previous disabled" aria-controls="DataTables_Table_0"><label th:text="#{page.previous}"></label></a>
    <a th:if="${page.current gt 1}" class="paginate_button previous gotoPage" aria-controls="DataTables_Table_0"
       th:pageNo="${page.current-1}"><label th:text="#{page.previous}"></label></a>
    <span th:if="${(page.current-4) gt 0}"><a class="paginate_button gotoPage" aria-controls="DataTables_Table_0"
                                                    th:pageNo="${page.current-4}"
                                                    th:text="${page.current-4}">1</a></span>
    <span th:if="${(page.current-3) gt 0}"><a class="paginate_button gotoPage" aria-controls="DataTables_Table_0"
                                                    th:pageNo="${page.current-3}"
                                                    th:text="${page.current-3}">1</a></span>
    <span th:if="${(page.current-2) gt 0}"><a class="paginate_button gotoPage" aria-controls="DataTables_Table_0"
                                                    th:pageNo="${page.current-2}"
                                                    th:text="${page.current-2}">1</a></span>
    <span th:if="${(page.current-1) gt 0}"><a class="paginate_button gotoPage" aria-controls="DataTables_Table_0"
                                                    th:pageNo="${page.current-1}"
                                                    th:text="${page.current-1}">1</a></span>
    <span><a class="paginate_button current" aria-controls="DataTables_Table_0"
             th:text="${page.current}">1</a></span>
    <span th:if="${(page.current) lt page.getPages()}"><a class="paginate_button gotoPage"
                                                                    aria-controls="DataTables_Table_0"
                                                                    th:pageNo="${page.current+1}"
                                                                    th:text="${page.current+1}">1</a></span>
    <span th:if="${(page.current+1) lt page.getPages()}"><a class="paginate_button gotoPage"
                                                                      aria-controls="DataTables_Table_0"
                                                                      th:pageNo="${page.current+2}"
                                                                      th:text="${page.current+2}">1</a></span>
    <span th:if="${(page.current+2) lt page.getPages()}"><a class="paginate_button gotoPage"
                                                                      aria-controls="DataTables_Table_0"
                                                                      th:pageNo="${page.current+3}"
                                                                      th:text="${page.current+3}">1</a></span>
    <span th:if="${(page.current+3) lt page.getPages()}"><a class="paginate_button gotoPage"
                                                                      aria-controls="DataTables_Table_0"
                                                                      th:pageNo="${page.current+4}"
                                                                      th:text="${page.current+4}">1</a></span>
    <a th:if="${page.current lt page.getPages()}" class="paginate_button next gotoPage"
       aria-controls="DataTables_Table_0" th:pageNo="${page.current+1}"><label th:text="#{page.next}"></label></a>
    <a th:if="${page.current eq page.getPages()}" class="paginate_button next disabled"
       aria-controls="DataTables_Table_0"><label th:text="#{page.next}"></label></a>
</div>

<div th:fragment="paginationJson(json)" class="dataTables_paginate paging_simple_numbers">
    <a th:if="${json.getInteger('current') eq 1}" class="paginate_button previous disabled" aria-controls="DataTables_Table_0"><label th:text="#{page.previous}"></label></a>
    <a th:if="${json.getInteger('current') gt 1}" class="paginate_button previous gotoPage" aria-controls="DataTables_Table_0"
       th:pageNo="${json.getInteger('current')-1}"><label th:text="#{page.previous}"></label></a>
    <span th:if="${(json.getInteger('current')-4) gt 0}"><a class="paginate_button gotoPage" aria-controls="DataTables_Table_0"
                                              th:pageNo="${json.getInteger('current')-4}"
                                              th:text="${json.getInteger('current')-4}">1</a></span>
    <span th:if="${(json.getInteger('current')-3) gt 0}"><a class="paginate_button gotoPage" aria-controls="DataTables_Table_0"
                                              th:pageNo="${json.getInteger('current')-3}"
                                              th:text="${json.getInteger('current')-3}">1</a></span>
    <span th:if="${(json.getInteger('current')-2) gt 0}"><a class="paginate_button gotoPage" aria-controls="DataTables_Table_0"
                                              th:pageNo="${json.getInteger('current')-2}"
                                              th:text="${json.getInteger('current')-2}">1</a></span>
    <span th:if="${(json.getInteger('current')-1) gt 0}"><a class="paginate_button gotoPage" aria-controls="DataTables_Table_0"
                                              th:pageNo="${json.getInteger('current')-1}"
                                              th:text="${json.getInteger('current')-1}">1</a></span>
    <span><a class="paginate_button current" aria-controls="DataTables_Table_0"
             th:text="${json.getInteger('current')}">1</a></span>
    <span th:if="${(json.getInteger('current')) lt json.getInteger('pages')}"><a class="paginate_button gotoPage"
                                                          aria-controls="DataTables_Table_0"
                                                          th:pageNo="${json.getInteger('current')+1}"
                                                          th:text="${json.getInteger('current')+1}">1</a></span>
    <span th:if="${(json.getInteger('current')+1) lt json.getInteger('pages')}"><a class="paginate_button gotoPage"
                                                            aria-controls="DataTables_Table_0"
                                                            th:pageNo="${json.getInteger('current')+2}"
                                                            th:text="${json.getInteger('current')+2}">1</a></span>
    <span th:if="${(json.getInteger('current')+2) lt json.getInteger('pages')}"><a class="paginate_button gotoPage"
                                                            aria-controls="DataTables_Table_0"
                                                            th:pageNo="${json.getInteger('current')+3}"
                                                            th:text="${json.getInteger('current')+3}">1</a></span>
    <span th:if="${(json.getInteger('current')+3) lt json.getInteger('pages')}"><a class="paginate_button gotoPage"
                                                            aria-controls="DataTables_Table_0"
                                                            th:pageNo="${json.getInteger('current')+4}"
                                                            th:text="${json.getInteger('current')+4}">1</a></span>
    <a th:if="${json.getInteger('current') lt json.getInteger('pages')}" class="paginate_button next gotoPage"
       aria-controls="DataTables_Table_0" th:pageNo="${json.getInteger('current')+1}"><label th:text="#{page.next}"></label></a>
    <a th:if="${json.getInteger('current') eq json.getInteger('pages')}" class="paginate_button next disabled"
       aria-controls="DataTables_Table_0"><label th:text="#{page.next}"></label></a>
</div>

<script th:fragment="pageScript" type="text/javascript">
    $(function () {
        $(".gotoPage").click(function () {
            $("#page").val($(this).attr("pageNo"));
            $("#searchForm").submit();
        });
    });
</script>